package com.company.project.sys.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 用户
  * @author ZYF
 * @date 2021/5/18 11:03
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel(value = "用户")
public class SysUser extends BaseEntity implements Serializable {
    @TableId
    @ApiModelProperty(value = "id")
    private String id;

    @NotBlank(message = "账号不能为空")
    @ApiModelProperty(value = "账户名称")
    private String username;

    @ApiModelProperty(value = "加密盐值")
    private String salt;

    @NotBlank(message = "密码不能为空")
    @ApiModelProperty(value = "密码")
    private String password;

    @TableField(exist = false)
    @ApiModelProperty(value = "旧密码")
    private String oldPwd;

    @TableField(exist = false)
    @ApiModelProperty(value = "新密码")
    private String newPwd;

    @ApiModelProperty(value = "手机号码")
    private String phone;

    @ApiModelProperty(value = "部门id")
    private String deptId;

    @TableField(exist = false)
    @ApiModelProperty(value = "部门名称")
    private String deptName;

    @TableField(exist = false)
    @ApiModelProperty(value = "部门编号")
    private String deptNo;

    @ApiModelProperty(value = "真实名称")
    private String realName;

    @ApiModelProperty(value = "昵称")
    private String nickName;

    @ApiModelProperty(value="邮箱(唯一)")
    private String email;

    @ApiModelProperty(value = "账户状态(1.正常 2.锁定 )")
    private Integer status;

    @ApiModelProperty(value = "性别(1.男 2.女)")
    private Integer sex;

    @ApiModelProperty(value = "是否删除(1未删除；0已删除)")
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

    @ApiModelProperty(value = "创建人")
    private String createId;

    @ApiModelProperty(value = "更新人")
    private String updateId;

    @ApiModelProperty(value = "创建来源(1.web 2.android 3.ios )")
    private Integer createWhere;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "开始时间")
    private String startTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "结束时间")
    private String endTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "角色列表")
    private List<String> roleIds;

    @TableField(exist = false)
    @ApiModelProperty(value = "权限列表")
    private String captcha;

    @TableField(exist = false)
    @ApiModelProperty(value = "验证码的KEY")
    private String uuid;
}